/*
 * @author: sanbao
 * @Date: 2022-07-22 14:21:10
 */
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import layout from '../layout/index.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: '_login',
    component: () => import('../components/page/login/index.vue')
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('../components/page/404/index.vue')
  },
  {
    path: '/',
    name: '_layout',
    component: layout,
    redirect: '/index',
    children: [
      {
        path: '/index',
        name: '_index',
        component: () => import('../components/page/index/index.vue')
      },
      {
        path: '/users',
        name: '_users',
        component: () => import('../components/page/users/index.vue')
      },
      {
        path: '/rights',
        name: '_rights',
        component: () => import('../components/page/rights/index.vue')
      },
      {
        path: '/roles',
        name: '_roles',
        component: () => import('../components/page/roles/index.vue')
      },
      {
        path: '/params',
        name: '_params',
        component: () => import('../components/page/params/index.vue')
      },
      {
        path: '/categories',
        name: '_categories',
        component: () => import('../components/page/categories/index.vue')
      },
      {
        path: '/orders',
        name: '_orders',
        component: () => import('../components/page/orders/index.vue')
      },
      {
        path: '/reports',
        name: '_reports',
        component: () => import('../components/page/reports/index.vue')
      },
      {
        path: '/goods',
        name: '_goods',
        component: () => import('../components/page/goods/index.vue')
      },
      {
        path: '/add',
        name: '_add',
        component: () => import('../components/page/goods/chlid/addgoodsshop.vue')
      },
    ]
  },

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
